<template>
  <!-- 这是联系我们的设置,包括流程图和内容 -->
  <div class="novice-container">
    <el-card class="box-card">
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="流程图">
          <el-input v-model="form.img" />
        </el-form-item>
        <el-form-item label="内容">
          <el-input
            v-model="form.content"
            type="textarea"
            :rows="25"
          />
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click.native.prevent="ChangeSetting">确认</el-button>
          <el-button>取消</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import { getNovice, modifyNovice } from '@/api/Novice'
export default {
  data() {
    return {
      form: {
        img: '',
        content: ''
      }
    }
  },
  created() {
    this.loadNovice()
  },
  methods: {
    // 获取"联系我们"的信息列表
    name: 'Novice',
    loadNovice() {
      getNovice().then(res => {
        this.form = res.data
      })
    },
    // 修改"联系我们"的内容
    ChangeSetting() {
      modifyNovice(this.form).then(data => {
        console.log(this.form)
        console.log(data.message)
        // alert(data.msg)
        this.$message({
          type: 'success',
          message: '成功'
        })
      })
    }
  }
}
</script>

<style>

</style>
